<% title t("views.dashboard.analytics.meta.title") %>

<main class="dashboard-container analytics-container crayons-layout" id="main-content">
  <nav aria-label="Dashboards" class="mx-5">
    <ul class="list-none">
      <li>
        <a href="<%= dashboard_path %>" class="rounded-btn crayons-link--block rounded-btn--transparent"><%= t("views.dashboard.analytics.back") %></a>
      </li>
      <% if @organizations.any? %>
        <li>
          <a class="rounded-btn crayons-link--block organization" 
             href="<%= dashboard_analytics_path %>"
             <%= params[:org_id] ? "" : 'aria-current="page"'.html_safe %>>
             <%= t("views.dashboard.analytics.your") %>
          </a>
        </li>
        <% @organizations.each do |org| %>
          <li>
            <a
              class="rounded-btn crayons-link--block organization"
              href="<%= dashboard_analytics_org_path(org.id) %>"
              data-organization-id="<%= org.id %>"
              <%= params[:org_id].to_i == org.id ? 'aria-current="page"'.html_safe : "" %>>
              <%= t("views.dashboard.analytics.org", org: org.name) %>
            </a>
          </li>
        <% end %>
      <% end %>
      </ul>
    </nav>
      

  <h1 class="fs-4xl fw-bold mx-5"><%= t("views.dashboard.analytics.heading", name: @user_or_org.name) %></h1>

  <%= render "shared/stats" %>
</main>

<%= javascript_include_tag "analyticsDashboard", defer: true %>
